﻿using Foundation.Core;

namespace Dyao.Book.Core
{
    public class AssemblyISelectTypeFilter : SelectTypeFilter
    {
        public AssemblyISelectTypeFilter(SelectFilterRegistrar registrar) : base(registrar)
        {
        }
        HashSet<string> fullnames = new HashSet<string>();
        /// <summary>
        /// 过滤程序集 
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public override bool IsAllowType(Type type)
        {
            if (base.IsAllowType(type) && !fullnames.Contains(type.FullName))
            {
                fullnames.Add(type.FullName);
                return true;
            }
            return false;
        }
    }
}
